package job.work.domain.system.entity.pojo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * 菜单类
 */
@Data
@Entity //代表当前是实体类dec
@Table(name="dec_menu")//对应mysql 表名
@ApiModel("菜单类")//标记当前实体类
public class DecMenu implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 父菜单ID
     */
    @NotNull(message = "父菜单ID不能为空")
    @ApiModelProperty(value = "父菜单ID 如果是顶级菜单 父ID则为0",required = true)
    private Long pid;

    /**
     * 菜单名称
     */
    @ApiModelProperty(value = "菜单名称",required = true)
    @NotNull(message = "菜单名称")
    private String menuName;

    @ApiModelProperty(value ="后端方法名",required = true)
    @NotNull(message = "方法名不能为空")
    private String url;

    @ApiModelProperty(value ="跳转节点0为菜单节点 1 为跳转节点",required = true)
    private int isMenu;

    @ApiModelProperty(value = "查看返回前端关键词")
    private String name;


    /**
     * 菜单集合
     */
    @ApiModelProperty("菜单集合")
    @Transient
    List<DecMenu> children;


}
